-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(document): avoid massive perf degradation when saving new doc with 10 level deep subdocs #14910
Conversation
…h 10 level deep subdocs Fix #14897
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, will this be in the next minor version for caution?
I don't think it is necessary to put this change in a minor release. As far as I can tell, there's no observable difference with the changes in this PR other than perf improvements. Subdoc middleware and getters will still get called normally, this PR just removes a bunch of work. |
No meaningful change on |
Fix #14897
Summary
Saving a new doc with many very deep subdocs is extremely expensive: the test case in this PR fails after 35 seconds on my local without the change I made to
lib/document.js
. Saving a new doc 10 levels deep is still more expensive than I'd like, this test now takes maybe 300ms, I'll investigate why this is so slow and add a benchmark.Examples